package com.itheima.demo;

import com.itheima.domain.Person;

import java.lang.reflect.Method;

/**
 * @author Zhang_Han
 * @version 1.0
 * @date 2020/7/17 16:23
 */
public class Demo_007 {
    public static void main(String[] args) throws NoSuchMethodException {
        Class clazz = Person.class;

        method001(clazz);
        method002(clazz);
        method003(clazz);


    }

    private static void method003(Class clazz) throws NoSuchMethodException {
        Method method = clazz.getMethod("mathod", String.class);
        System.out.println(method);
    }

    private static void method002(Class clazz) throws NoSuchMethodException {
        Method method = clazz.getMethod("function", String.class);
        System.out.println(method);
    }

    private static void method001(Class clazz) throws NoSuchMethodException {
        Method method = clazz.getMethod("show");

        System.out.println(method);
    }
}
